﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Net;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

using System.Text;
using System.Data;
using System.Threading;

namespace VideoOnline.FFmpeg
{
    public class BackThread
    {
        public HttpContext context
        {
            get;
            set;
        }
        public  void TransThread()
        {
            string FileDir;
            string VideoName;
            string VideoId;
            Main main = new Main();
            main.context = this.context;
            while (true)
            {
                if (GlobalClass.TransList.Count == 0)
                {
                    Thread.Sleep(5000);
                    continue;
                }
                FileDir = GlobalClass.TransList[0]["FileDir"].ToString();
                VideoName = GlobalClass.TransList[0]["VideoName"].ToString();
                VideoId = GlobalClass.TransList[0]["VideoId"].ToString();
                main.Transformation(FileDir, VideoName, VideoId);
                GlobalClass.TransList.RemoveAt(0);

            }





        }


    }
}